package com.xuzhen.designPattern.decorator.two;

//http://www.cnblogs.com/rush/archive/2011/05/08/Decorator_DesignPattern_NETFramework.html
public class Test {
	public static void main(String[] args) {
		Component p1 = new IPMsg();
		DestAddress A = new DestAddress(p1);
		A.addMessage();

		System.out.println("-----------------------------------------------");
		Component p2 = new IPMsg();
		DestAddress A2 = new DestAddress(p2);
		SourAddress c = new SourAddress(A2);
		c.addMessage();

	}
}
